package com.cn.api.method;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class SessionUtile {

	public static void addSession(HttpServletRequest request, String sessionKey, String sessionValue) {
		HttpSession session = request.getSession();
		session.setAttribute(sessionKey, sessionValue);
	}

	public static String getSession(HttpServletRequest request, String sessionKey) {

		HttpSession session = request.getSession();
		Object sessionValue = session.getAttribute(sessionKey) == null ? "" : session.getAttribute(sessionKey);
		return sessionValue.toString();
	}
}
